$(function () {
    var $height1=$(window).height();

    $(".body").css('height',$height1+'px')
    var $tabheight=parseFloat($('.register').height());
    $(".register").css('margin-top',$height1/2-$tabheight)
    $('#register').attr("disabled",true);  //注册按钮
    $('#register').css("background-color",'gray');
    $(".repsword").blur(function(){  //请再次输入密码
        var $id=$(".id").val();
        var check=new RegExp();
        if (/^\d{10}$/.test($id))
        {
            console.log($id);
            var $psword=$(".psword").val();
            console.log($psword);
            var $repsword=$(".repsword").val();
            console.log($repsword);
            if ($psword==$repsword)
            {
                $('#register').css("background-color",'blue');
                $('#register').attr("disabled",false);

            }
            else{
                $('#register').css("background-color",'gray');
                $('#register').attr("disabled",false);
            }
        }
        else{
            $('#register').css("background-color",'gray');
            $('#register').attr("disabled",false);

        }
    });
    $(".psword").blur(function(){  //请输入密码
        var $id=$(".id").val();
        var check=new RegExp();
        if (/^\d{10}$/.test($id))
        {
            console.log($id);
            var $psword=$(".psword").val();
            console.log($psword);
            var $repsword=$(".repsword").val();
            console.log($repsword);
            if ($psword==$repsword)
            {
                $('#register').css("background-color",'blue');
                $('#register').attr("disabled",false);

            }
            else{
                $('#register').css("background-color",'gray');
                $('#register').attr("disabled",false);
            }
        }
        else{
            $('#register').css("background-color",'gray');
            $('#register').attr("disabled",false);

        }
    });
    $(".id").blur(function(){    //请输入10位数学号  
        var $id=$(".id").val();
        var check=new RegExp();
        if (/^\d{10}$/.test($id))
        {
            console.log($id);
            var $psword=$(".psword").val();
            console.log($psword);
            var $repsword=$(".repsword").val();
            console.log($repsword);
            if ($psword==$repsword) 
            {
                $('#register').css("background-color",'blue');
                $('#register').attr("disabled",false);

            }
            else{
                $('#register').css("background-color",'gray');
                $('#register').attr("disabled",false);
            }
        }
        else{
            $('#register').css("background-color",'gray');
            $('#register').attr("disabled",false);

        }
    });



})